myMoneyTotal = 0.00

print("==="*5,"自动取款机的存取款模拟操作系统","==="*10)
print("{0:<10}  {1:<10}".format("1. 登陆","2. 退出"))


key = input("请输入序号对应的选择并按回车键：")
if key == "1":
        print("=="*12,"恭喜您登录成功","=="*12)
        print("{0:<10}  {1:<10}  {2:<10} {3:<10}".format("1. 查询余额","2. 取钱","3.存钱","4.退出操作系统"))
        while True:
            key = input("请输入序号对应的选择并按回车键：")
            if key == "1":
                if myMoneyTotal < 100:
                    print("亲！您的余额剩余{:.2f}￥".format(myMoneyTotal))
                else :
                    print("您的余额为:{:.2f}￥".format(myMoneyTotal))
                    
            elif key == "2":
                getMoney = input("请输入您要取款金额:")
                if myMoneyTotal < int(getMoney):
                    print('抱歉！您的余额不足,取款失败')
                else :
                    print("取款成功")
                    myMoneyTotal -= int(getMoney)
                    print("您的余额为:{:.2f}￥".format(myMoneyTotal))
            elif key == "3":
                giveMoney = input("请输入您要存款金额:")
                print("存款成功")
                myMoneyTotal += int(giveMoney)
                print("您的余额为:{:.2f}￥".format(myMoneyTotal))
            else :
                print("=="*12,"请取回您的储蓄卡,再见","=="*12)
                break
elif key == "2":
    print("=="*12,"退出操作系统","=="*12)
 

